package com.ydl.learning.flink.demo.pipeline

import com.ydl.learning.flink.demo.pipeline.impl.{BroadcastProcessImpl, ProcessImpl, SinkImpl, SourceImpl}
import com.ydl.learning.flink.demo.pipeline.java.entity.JobConfig

/**
 *
 *
 * @author ydl
 * @since 2022/1/7
 */
object Demo extends App {
  val jobConfig: JobConfig = new JobConfig()
  jobConfig.setDefaultParallelism(2)
  jobConfig.setMaxParallelism(10)
  jobConfig.setJobName("pipelineDemo")
  jobConfig.set("host", "127.0.0.1")
  jobConfig.set("port", "9999")
  val pipeline: Pipeline[String] = new Pipeline.Builder[String]
      .jobConfig(jobConfig)
      .init(new SourceImpl)
      .process(new ProcessImpl)
      .process(new BroadcastProcessImpl)
      .sink(new SinkImpl[String])
      .build
  pipeline.execute()

}
